package com.tudouji.project.harvest.mapper;

import com.tudouji.project.harvest.domain.Freightorder;
import com.tudouji.project.harvest.domain.FreightorderExport;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 货运单Mapper接口
 *
 * @author wf
 * @date 2021-01-18
 */
public interface FreightorderMapper
{
    /**
     * 查询货运单
     *
     * @param guid 货运单ID
     * @return 货运单
     */
    public Freightorder selectFreightorderById(String guid);
    public Freightorder selectFreightorderByAutoId(Long id);
    public Freightorder selectFreightorderByCode(String code);
    public Freightorder selectFreightorderByOrdercode(String code);

    public Freightorder selectFreightorderDetailById(String guid);
    public Freightorder selectFreightorderDetailByAutoId(Long id);

    /**
     * 查询货运单列表
     *
     * @param freightorder 货运单
     * @return 货运单集合
     */
    public List<Freightorder> selectFreightorderList(Freightorder freightorder);
    public Freightorder selectFreightorderListSum(Freightorder freightorder);

    public List<FreightorderExport> selectFreightorder(FreightorderExport freightorder);

    /**
     * 新增货运单
     *
     * @param freightorder 货运单
     * @return 结果
     */
    public int insertFreightorder(Freightorder freightorder);

    /**
     * 修改货运单
     *
     * @param freightorder 货运单
     * @return 结果
     */
    public int updateFreightorder(Freightorder freightorder);

    /**
     * 删除货运单
     *
     * @param guid 货运单ID
     * @return 结果
     */
    public int deleteFreightorderById(String guid);

    /**
     * 批量删除货运单
     *
     * @param guids 需要删除的数据ID
     * @return 结果
     */
    public int deleteFreightorderByIds(String[] guids);

    BigDecimal getWeightSumByContract(String guid);

    int getFreightOrderByTime(Date dateBeforeDay);

    List<Freightorder> selectApplyPendingList(Freightorder freightorder);

    List<Freightorder> statisticsOrderFive(Freightorder freightorder);
    List<Freightorder> statisticsOrderByPlan(Freightorder freightorder);

}
